/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.gameshop.gui;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author MarcioMorando
 */
@Entity
@Table(name = "e002cadforn", catalog = "mydb", schema = "")
@NamedQueries({
    @NamedQuery(name = "E002cadforn.findAll", query = "SELECT e FROM E002cadforn e"),
    @NamedQuery(name = "E002cadforn.findByIdFornecedor", query = "SELECT e FROM E002cadforn e WHERE e.idFornecedor = :idFornecedor"),
    @NamedQuery(name = "E002cadforn.findByNome", query = "SELECT e FROM E002cadforn e WHERE e.nome = :nome"),
    @NamedQuery(name = "E002cadforn.findByCpfCnpj", query = "SELECT e FROM E002cadforn e WHERE e.cpfCnpj = :cpfCnpj"),
    @NamedQuery(name = "E002cadforn.findByEndereco", query = "SELECT e FROM E002cadforn e WHERE e.endereco = :endereco"),
    @NamedQuery(name = "E002cadforn.findByCidade", query = "SELECT e FROM E002cadforn e WHERE e.cidade = :cidade"),
    @NamedQuery(name = "E002cadforn.findByUf", query = "SELECT e FROM E002cadforn e WHERE e.uf = :uf"),
    @NamedQuery(name = "E002cadforn.findByEmail", query = "SELECT e FROM E002cadforn e WHERE e.email = :email"),
    @NamedQuery(name = "E002cadforn.findByTelefone", query = "SELECT e FROM E002cadforn e WHERE e.telefone = :telefone")})
public class E002cadforn implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_Fornecedor")
    private Integer idFornecedor;
    @Column(name = "nome")
    private String nome;
    @Column(name = "cpf_cnpj")
    private String cpfCnpj;
    @Column(name = "endereco")
    private String endereco;
    @Column(name = "cidade")
    private String cidade;
    @Column(name = "uf")
    private String uf;
    @Column(name = "email")
    private String email;
    @Column(name = "telefone")
    private String telefone;

    public E002cadforn() {
    }

    public E002cadforn(Integer idFornecedor) {
        this.idFornecedor = idFornecedor;
    }

    public Integer getIdFornecedor() {
        return idFornecedor;
    }

    public void setIdFornecedor(Integer idFornecedor) {
        Integer oldIdFornecedor = this.idFornecedor;
        this.idFornecedor = idFornecedor;
        changeSupport.firePropertyChange("idFornecedor", oldIdFornecedor, idFornecedor);
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        String oldNome = this.nome;
        this.nome = nome;
        changeSupport.firePropertyChange("nome", oldNome, nome);
    }

    public String getCpfCnpj() {
        return cpfCnpj;
    }

    public void setCpfCnpj(String cpfCnpj) {
        String oldCpfCnpj = this.cpfCnpj;
        this.cpfCnpj = cpfCnpj;
        changeSupport.firePropertyChange("cpfCnpj", oldCpfCnpj, cpfCnpj);
    }

    public String getEndereco() {
        return endereco;
    }

    public void setEndereco(String endereco) {
        String oldEndereco = this.endereco;
        this.endereco = endereco;
        changeSupport.firePropertyChange("endereco", oldEndereco, endereco);
    }

    public String getCidade() {
        return cidade;
    }

    public void setCidade(String cidade) {
        String oldCidade = this.cidade;
        this.cidade = cidade;
        changeSupport.firePropertyChange("cidade", oldCidade, cidade);
    }

    public String getUf() {
        return uf;
    }

    public void setUf(String uf) {
        String oldUf = this.uf;
        this.uf = uf;
        changeSupport.firePropertyChange("uf", oldUf, uf);
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        String oldEmail = this.email;
        this.email = email;
        changeSupport.firePropertyChange("email", oldEmail, email);
    }

    public String getTelefone() {
        return telefone;
    }

    public void setTelefone(String telefone) {
        String oldTelefone = this.telefone;
        this.telefone = telefone;
        changeSupport.firePropertyChange("telefone", oldTelefone, telefone);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idFornecedor != null ? idFornecedor.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof E002cadforn)) {
            return false;
        }
        E002cadforn other = (E002cadforn) object;
        if ((this.idFornecedor == null && other.idFornecedor != null) || (this.idFornecedor != null && !this.idFornecedor.equals(other.idFornecedor))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.gameshop.gui.E002cadforn[ idFornecedor=" + idFornecedor + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }

}
